<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title></title>
  </head>
  <body>
    <form id="form1">
      <input type="text" name="user" value="">
      <input type="text" name="pass" value=""><br/>
      <input type="button" id="reg" value="注册">
      <input type="button" id="btn" value="提交">
    </form>
    <script type="text/javascript" src="./js/jquery.js" ></script>
    <script type="text/javascript" src="./js/common.js" ></script>
    <script>

      $("#reg").click(()=>{
          $.ajax({
              url:"/reg",
              contentType:"json",
              method:"post",
              data:{user:form1.user.value,pass:form1.pass.value},
              success(data){
                  console.log(data);
              }
          });
      });
      $("#btn").click(()=>{
          $.ajax({
              url:"/login",
              contentType:"json",
              method:"post",
              data:{user:form1.user.value,pass:form1.pass.value},
              success(data){
                  console.log(data);
              }
          });
      });
    </script>
  </body>
</html>
